//
//  KSInTransitViewController.swift
//  Supermarket
//
//  Created by Black_Crystal on 2017/9/25.
//  Copyright © 2017年 kushao. All rights reserved.
//

import UIKit

class KSInTransitViewController: KSBaseViewController,ChangeAddressDelegate {

    let bottomHeihght: CGFloat = 50
    override func viewDidLoad() {
        super.viewDidLoad()

        self.view.backgroundColor = KSColor.kColorViewBackground
        
        let tableview = UITableView.init()
        tableview.delegate = self
        tableview.dataSource = self
        tableview.rowHeight = 400
        tableview.backgroundColor = UIColor.white
        tableview.separatorStyle = .none
        tableview.register(KSInTransitTableViewCell.self, forCellReuseIdentifier: "KSInTransitTableViewCell")
        self.view.addSubview(tableview)
        tableview.snp.makeConstraints { (make) in
            make.left.top.right.equalTo(0)
            make.height.equalTo(450)
        }

        let seeOrderBtn = UIButton()
        seeOrderBtn.setTitle("查看订单", for: .normal)
        seeOrderBtn.setTitleColor(UIColor.white, for: .normal)
        seeOrderBtn.backgroundColor = KSColor.kColorMainRed
        seeOrderBtn.addTarget(self, action: #selector(seeOrderEvent), for: .touchDown)
        self.view.addSubview(seeOrderBtn)
        seeOrderBtn.snp.makeConstraints { (make) in
            make.left.right.bottom.equalTo(0)
            make.height.equalTo(bottomHeihght)
        }
//        let kspickView = KSPickerOrderChooseView()
//        self.view.addSubview(kspickView)
//        kspickView.snp.makeConstraints { (make) in
//            make.top.left.right.equalTo(0)
//            make.height.equalTo(400)
//        }
    }
    
    @objc func seeOrderEvent() {
        
    }
    
    func changeAddressCallBack() {
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
}

extension KSInTransitViewController: UITableViewDelegate,UITableViewDataSource {
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 1
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "KSInTransitTableViewCell", for: indexPath) as! KSInTransitTableViewCell
        cell.selectionStyle = .none
        cell.delegate = self
        return cell
    }
}
